//
//  UINavigationController+JFNavAttribute.m
//  JFBase
//
//  Created by Alan Wang on 2018/11/29.
//  Copyright © 2018 Alan Wang. All rights reserved.
//

#import "UINavigationController+JFNavAttribute.h"
#import <objc/runtime.h>

static char *navBackGroundColor_JF = "navBackGroundColor_JF";
static char *navTintColor_JF = "navTintColor_JF";
static char *navBootomLineColor_JF = "navBootomLineColor_JF";
static char *navBarStyle_JF = "navBarStyle_JF";

@implementation UINavigationController (JFNavAttribute)

-(void)setNavBarStyle:(UIBarStyle)navBarStyle{
    objc_setAssociatedObject(self, navBarStyle_JF, @(navBarStyle), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
-(UIBarStyle)navBarStyle{
     return [objc_getAssociatedObject(self, navBarStyle_JF) integerValue];
}
-(void)setNavBackGroundColor:(UIColor *)navBackGroundColor{
      objc_setAssociatedObject(self, navBackGroundColor_JF, navBackGroundColor, OBJC_ASSOCIATION_COPY_NONATOMIC);
}
-(UIColor*)navBackGroundColor{
      return objc_getAssociatedObject(self, navBackGroundColor_JF);
}
-(void)setNavBootomLineColor:(UIColor *)navBootomLineColor{
        objc_setAssociatedObject(self, navBootomLineColor_JF, navBootomLineColor, OBJC_ASSOCIATION_COPY_NONATOMIC);
}
-(UIColor*)navBootomLineColor{
     return objc_getAssociatedObject(self, navBootomLineColor_JF);
}
-(void)setNavTintColor:(UIColor *)tintColor{
    objc_setAssociatedObject(self, navTintColor_JF, tintColor, OBJC_ASSOCIATION_COPY_NONATOMIC);
}
-(UIColor*)navTintColor{
    return objc_getAssociatedObject(self, navTintColor_JF);
}

@end
